package com.qfedu.aunt.commons.config;

import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * @author xiaobobo
 * @title: RedisConfig
 * @projectName aunt_commons_2209
 * @description: TODO
 * @date 2022/11/4  10:25
 */
@SpringBootConfiguration
public class RedisConfig {

    @Bean
    public RedisTemplate redisTemplate(RedisConnectionFactory connectionFactory){
        RedisTemplate redisTemplate = new RedisTemplate<>();
        redisTemplate.setEnableTransactionSupport(true);
        redisTemplate.setConnectionFactory(connectionFactory);
        return redisTemplate;
    }

}
